<template>
  <div id="Student">
    <div class="name">{{ data.name }}</div>
    <div class="age" @click="_c_click">{{ data.age }}</div>
    <button @click="unbind">解绑</button>
  </div>
</template>

<script>
export default {
  name: "Student",
  props:{
    data:{type:Object,required:false},
    defaultData:{type: Object,required: false}
  },
  data() {
    return {
      name:'张三',
      age:22,
      arr:[
        {name:'李四',age:20}
      ]
    };
  },
  mounted(){
    this.$bus.$on('hello',(data)=>{
      console.log(2);
      console.log('我是组件，收到了'+ data);
    })
  },
  methods:{
    _c_click(){
      // this.$emit('_c_close',this.arr);
      // this.$emit('demo',this.name)
    },
    unbind(){
      // this.$off(['_c_close','demo'])
    }
  }
};
</script>

<style>
</style>